home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1988 January & February / rerun-1988-01-02.d64 / time keeper boot (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  1KB  |  35 lines

  1. 1 rem time-keeper 64
  2. 2 rem (c) 1987 bob kodadek
  3. 3 rem
  4. 4 f$="ob.tk 64":print"loading "f$:if a=0 then a=1:load (f$),8,1
  5. 5 print chr$(147) chr$(14) chr$(13) spc(11)"[212]ime-[203]eeper 64":print
  6. 6 dim md(12):fori=1to12:read md(i):next
  7. 7 ml=49700:cl=49712:u$=chr$(145)+chr$(145)
  8. 8 fori=0to3:e$=e$+chr$(32):next
  9. 9 fori=0to3:e$=e$+chr$(157):next
  10. 10 print spc(8)"[211]et the date (mn/dt/yr)":print
  11. 11 print"month  (1-12)"e$;:input mn
  12. 12 if mn<1 or mn>12 then print u$:goto11
  13. 13 s$=right$(str$(md(mn)),2)+")"
  14. 14 print spc(1)"date  (1-"s$ e$;:input dt
  15. 15 if dt<1 or dt>md(mn) then print u$:goto14
  16. 16 print spc(1)"year (86-99)"e$;:input yr
  17. 17 if yr<86 or yr>99 then print u$:goto16
  18. 18 print:print spc(8)"[211]et the time (hr/ms/am-pm)"
  19. 19 gosub24:poke cl,ms:poke cl+1,hr
  20. 20 poke cl+2,mn:poke cl+3,dt:poke cl+4,yr
  21. 21 print:print spc(8)"[211]et the [193]larm? (y or n)";:input a$
  22. 22 hr=0:ms=0:if a$="y" or a$="[217]" then gosub 24
  23. 23 poke cl+5,ms:poke cl+6,hr:sys ml:end
  24. 24 print:print"hours  (1-12)"e$;:input hr
  25. 25 if hr<1 or hr>12 then print u$:goto24
  26. 26 print spc(1)"mins  (0-59)"e$;:input ms
  27. 27 if ms >59 then print u$:goto26
  28. 28 print"am-pm   (a/p)"e$;:input p$
  29. 29 if p$ <>"a" and p$<>"p"then print u$:goto28
  30. 30 flag=0:if p$="p" then flag = 128
  31. 31 by=hr:gosub33:hr=by or flag
  32. 32 by=ms:gosub33:ms=by:return
  33. 33 x=int(by/10):y=by-10*x:by=16*x+y:return
  34. 34 data 31,29,30,31,30,30,31,31,30,31,30,31
  35.